import dataJson from '@/message/data/index.js'

function request(opion) {
    return new Promise((resolve, reject) => {
        setTimeout(function() {
            let res = dataJson[opion.jsonSrc]
            if (res !== undefined) {
                resolve({ code: 200, data: res, message: '返回成功' })
            } else {
                reject({ code: 400, data: null, message: '返回失败' })
            }

        }, 10);

    })
}

export default request